package com.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.domain.Business;
import com.crm.dto.SalesStatisticDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface BusinessMapper extends BaseMapper<Business> {
    List<SalesStatisticDTO> getBusinessChangeCount(LocalDateTime beginDateTime, LocalDateTime endDateTime);

//    List<SalesStatisticDTO> indexCount(LocalDateTime beginDateTime, LocalDateTime endDateTime);


    // int countByCreateby(@Param(createby)String createby);
    //根据用户id查商机总数
    @Select("select count(*) from business where user_id=#{userId}")
    int countByuserId(@Param("userId")Long userId);

}
